<?php $usuario_logado = $usuario_logado[0]; sleep(0.5);?>
           <?php
            $imgSeguir = array('src' => 'img/remove.png', 'alt' => 'Remover', 'title' => 'Deixar de Acompanhar Perfil');
            $imgMsg = array('src' => 'img/email.png', 'alt' => 'Mensagem', 'title' => 'Enviar Mensagem');

            if(!isset($print)){

                foreach($legais as $key => $row) :
                    $usuario    = element('usuario', $row);
                    $dica       = element('dica', $row);
                    
                    if(isset($usuario->avatar)){$imgConf = array('src' => 'upload/thumbs/' . $usuario->avatar, 'alt' => $usuario->username, 'title' => $usuario->username, 'width' => '60', 'height' => '60');}
                    ?>
                    <div id="dica">
                    <div class="avatar">
                        <?php if(isset($imgConf)) {?>
                            <?php echo anchor('usuario/timelineVisitanteView/' . $usuario->idUsuario, img($imgConf)) ; ?>
                        <?php }else{?>
                            <?php echo anchor('usuario/timelineVisitanteView/' . $usuario->idUsuario, img(array('src' => 'img/default_avatar.gif', 'alt' => $usuario->username, 'title' => $usuario->username, 'width' => '60', 'height' => '60'))); ?>
                        <?php } ?>
                    </div>

                    <div class="descricao" >
                        <h5 class="name"><?php echo $usuario->username ?> :: <?php echo $row['tempo']?></h5>
                        <p><?php echo anchor('/dica/index/' . $dica->idDica. '/' . $usuario->idUsuario , $dica->descricao); ?></p>
                    </div>

                    <div class="compartilhar">
                                    <?php $url = 'dica/Legal/' . $dica->idDica . '/' . $usuario->idUsuario;  $icon = "16"?>
                                    <ul>
                                        <li><a id="Legal<?php echo $dica->idDica?>" href="javascript:void[0];" onclick="abrirPag('<?php echo base_url(); ?>index.php/dica/legal/<?php echo $dica->idDica . '/' . $usuario->idUsuario; ?>', 'Legal<?php echo $dica->idDica; ?>');" ><?php echo img(array('src' => 'img/icon-acoes/like.png','alt' => $row['countLegal'], 'width' => $icon , 'height' => $icon ,'title' => $row['countLegal'])); ?></a></li>
                                        <li><a id="Vou<?php echo $dica->idDica?>" href="javascript:void[0];" onclick="abrirPag('<?php echo base_url(); ?>index.php/dica/euVou/<?php echo $dica->idDica . '/' . $usuario->idUsuario; ?>', 'Vou<?php echo $dica->idDica; ?>');" ><?php echo img(array('src' => 'img/icon-acoes/go.png','alt' => $row['countVou'], 'width' => $icon , 'height' => $icon, 'title' => $row['countVou'])); ?></a></li>
                                        <li><?php echo anchor('dica/mural/' . $dica->idDica . '/' . $usuario_logado->idUsuario, img(array('src' => 'img/icon-acoes/mural.png','alt' => "Mural", 'width' => $icon, 'height' => $icon, 'title' => "Mural"))) ?></li>
                                        <li><a href="javascript: void [0]" onclick="<?php echo "javascript:toggle('" . $dica->idDica . "')";?>"><?php echo img(array('src' => 'img/icon-acoes/share.png','alt' => "Compartilhar", 'width' => $icon , 'height' => $icon, 'title' => "Compartilhar")); ?></a></li>
                                    </ul>
                                </div>
                            
                                
                            <div id="<?php echo $dica->idDica;?>" class="redes_sociais" >
                                <?php $imgFacebook  = array('src' => 'img/facebook.png', 'alt' => 'Facebook', 'title' => 'Facebook', 'width' => '30', 'height' => '30'); 
                                       $imgTwitter = array('src' => 'img/twitter.png', 'alt' => 'Twitter', 'title' => 'Twitter', 'width' => '30', 'height' => '30');
                                       $url = urlencode(base_url() . "index.php/dica/index/" . $dica->idDica . "/" . $usuario->idUsuario);?>
                                <a href="javascript: void[0]" onclick="window.open('http://www.facebook.com/share.php?u=<?php echo $url?>','ventanacompartir', 'toolbar=0, status=0, width=650, height=450');"><?php echo img($imgFacebook); ?></a>
                                <a href="javascript: void[0]" onclick="window.open('http://twitter.com/share?text=<?php echo substr($dica->descricao, 0, 99); ?> on Hintweek','ventanacompartir', 'toolbar=0, status=0, width=650, height=450');" class="twitter-share-text" data-url="<?php echo $url; ?>"><?php echo img($imgTwitter);?></a>
                            </div>
                    </div>
            <?php
                    endforeach;
                }
                else
                {
                   echo $print;
                }
            ?>